package org.zs.asp04;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AspTransaction {

    @Before(value = "org.zs.asp04.CustomPoint.pc1()")
    public void beginTransaction()
    {
        System.out.println("事务开始");
    }
    @After(value = "org.zs.asp04.CustomPoint.pc1()")
    public void returnTransaction()
    {
        System.out.println("事务提交");
    }
    @AfterThrowing(value = "org.zs.asp04.CustomPoint.pc1()")
    public void thrwingTransaction()
    {
        System.out.println("事务异常");
    }
}
